<?php
echo "Student list:<br>";
include('Student.php');
include('course.php');
$students = array();

$ChineseCourse = new Course("Chinese");
$mathCourse= new Course("Math");
$EnglishCourse = new Course("English");

$first = new Student("Doe", "John","Freshman");
$first->add_email('home', 'john@doe.com');
$first->add_email('work', 'jdoe@mcdonalds.com');
$first->add_grade($ChineseCourse, 65);
$first->add_grade($mathCourse,75);
$first->add_grade($EnglishCourse,55);
$students['j123'] = $first;

$second = new Student("Einstein", "Albert","Junior");
$second->add_email('home', 'albert@braniacs.com');
$second->add_email('work1', 'a_einstein@bcit.ca');
$second->add_email('work2', 'albert@physics.mit.edu');
$second->add_grade($ChineseCourse,95);
$second->add_grade($mathCourse,80);
$second->add_grade($EnglishCourse,50);
$students['a456'] = $second;

$third = new Student("Lin", "Chen","Senior");
$third->add_email('home', 'Firefly@honkai.com');
$third->add_email('work1', 'lin@bcit.ca');
// $third->add_email('work2', 'albert@physics.mit.edu');
$third->add_grade($ChineseCourse,100);
$third->add_grade($mathCourse,96);
$third->add_grade($EnglishCourse,70);
$students['c789'] = $third;

$fourth = new Student("tao", "Hu","Senior");
$fourth->add_email('home', 'Hutao@liyue.com');
$fourth->add_email('work', 'hutao@bcit.ca');
// $third->add_email('work2', 'albert@physics.mit.edu');
$fourth->add_grade($ChineseCourse,90);
$fourth->add_grade($mathCourse,96);
$fourth->add_grade($EnglishCourse,80);
$students['h101112'] = $fourth;

ksort($students);
foreach ($students as $student)
    echo $student->toString();

